<?php
header("Content-type: text/html; charset=utf-8"); 
class ShowListss{
	var $sql_x;
	public function __construct($from,$num,$table,$where,$order){ 
		$this->sql_x="select title,id from ".$table." ".$where." ".$order." limit ".$from.",".$num;
	}

	public function tiebas($css){  /*css为完整的css格式。style:'...'*/
		$result=$this->init();
		while($row = $result->fetch_assoc()){
    		$id=$row['id'];
    		$title=$row['title'];
    		echo '<div><p '.$css.'><a href="tieba/detail_information.php?tid='.$id.'&page=1">'.$title.'</a></p></div>';
		}
	}
	public function comments($css){
		$result=$this->init();
		while($row = $result->fetch_assoc()){
    		$id=$row['id'];
    		$title=$row['title'];
    		echo '<div><p '.$css.'>'.$title.'</p></div>';

		}

	}
	private function init(){
		include 'config.php';
		$link = new ConnData();
		$result = $link->conn->query($this->sql_x);
		if($result === false){
    		echo $link->conn->error;
    		echo $link->conn->errno;
		}
		return $result;
	}
	
}
?>